﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Mall.Member
{
    public partial class reg_member : System.Web.UI.Page
    {
        public string r_code = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {

            MODEL.MMember model_member = new MODEL.MMember();
            Random rad = new Random();
            r_code = rad.Next(1000, 9999).ToString();
            //TempData["regmember_r_code"] = r_code;
            if (Request.Form["email"] != null)
            {//判断是否回发
                //BMember bll = new BMember();
                model_member.Email = Request.Form["email"] == null ? "" : Request.Form["email"].ToString();
                model_member.UserPwd = Request.Form["pwd"] == null ? "" : Request.Form["pwd"].ToString();
                //ViewData["model_member"] = model_member;

                //bll.CreateUser(model_member);
                BLL.Models.MemberModels models_member = new BLL.Models.MemberModels();
                models_member.CreateMemberS(model_member);
                if (string.IsNullOrEmpty(model_member.UserName))
                {

                    model_member.UserName = model_member.Email;
                }
                Response.Cookies["MemberName"].Value = model_member.UserName;
                Session["MemberName"] = model_member.UserName;
                Response.Redirect("/member/reg_mobile.aspx");
                //return RedirectToAction("reg_mobile", "member");
            }




        }
    }
}